package com.ghline.caloncabe.model;

import java.util.List;

import com.ghline.caloncabe.GameView;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class TempLevelUp {
    private int width;
    private int height;
	private int x = 0;
	private int y = 0;
	private Bitmap bmp;
	private int life = 2;
	private List<TempLevelUp> temps;

	public TempLevelUp(List<TempLevelUp> temps, GameView gameView, int x, int y, Bitmap bmp) {
		this.x = x;
		this.y = y;
		this.bmp = bmp;
		this.temps = temps;
		this.setWidth(bmp.getWidth());
        this.setHeight(bmp.getHeight());
	}

	public void draw(Canvas canvas) {
		update();
		canvas.drawBitmap(bmp, x, y, null);
	}

	private void update() {
		if (--life < 1) {
			temps.remove(this);
		}
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}
}
